package net.starwifi.wx.tools;

import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.UUID;

/**
 * Created by ruoo on 16/1/26.
 */
public class StringUtils {

    public static String makeURL(String url, Map<String,String> params){
        String result=url+"?";
        if(params==null){
            return url;
        }
        if(params.size()==0){
            return url;
        }
        Set dataSet = params.keySet();
        Iterator dataIte = dataSet.iterator();
        while (dataIte.hasNext()) {
            String key = (String)dataIte.next();
            String value = params.get(key);
            result=result+key+"="+value+"&";
        }
        return result.substring(0,result.length()-1);
    }



    public static String getUUID(){
        return UUID.randomUUID().toString().replace("-","").toUpperCase();
    }

}
